﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DriveBeamEditor.Controls.General.Popup;
using JBeamLibrary.Types;
using JBeamLibrary.VehicleParts;
using JBeamLibrary.VehicleParts.Elements;

namespace DriveBeamEditor.Controls.BeamNG.Popups
{
    public partial class Float3Popup : PopupContainer
    {
        #region Fields

        public event EventHandler<Float3> SelectedValueChanged;

        #endregion

        #region Properties

        public Float3 SelectedValue
        {
            get { return float3Edit.Float3; }
            set { float3Edit.Float3 = value; }
        }

        #endregion

        #region CTORs

        public Float3Popup()
        {
            InitializeComponent();
        }

        #endregion

        #region Events

        private void xbClose_Click(object sender, EventArgs e)
        {
            OnSelectedValueChanged();
            Close();
        }

        private void float3Edit_EditValueChanged(object sender, EventArgs e)
        {
            OnSelectedValueChanged();
        }

        #endregion

        #region Methods

        protected virtual void OnSelectedValueChanged()
        {
            if (SelectedValueChanged != null)
                SelectedValueChanged(this, SelectedValue);
        }

        #endregion


    }
}
